package com.hellohoper.script.config.engine.run;

import com.hellohoper.script.config.engine.run.bean.RunnerParam;
import com.hellohoper.script.config.engine.run.bean.RunnerResult;

/**
 * 执行脚本服务
 * Created by hk on 17/8/15.
 */
public interface ScriptRunnerService<K, V> {

    /**
     * 执行脚本，获得返回结果
     *
     * @param appName     appName
     * @param scriptName  scriptName
     * @param runnerParam HashMap
     * @return 脚本执行结果
     * @throws Exception E
     */
    RunnerResult<K, V> run(String appName, String scriptName, RunnerParam runnerParam) throws Exception;

    /**
     * 执行脚本，获得返回结果
     *
     * @param scriptName  scriptName
     * @param runnerParam HashMap
     * @return 脚本执行结果
     * @throws Exception E
     */
    RunnerResult<K, V> run(String scriptName, RunnerParam runnerParam) throws Exception;

}
